﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Login.ascx.cs" Inherits="Front_UserControl_Login" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<link href="../../Admin/CSS/Membership.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
    function SignInValidate() {

        var UserName = document.getElementById('<%= Login1.FindControl("UserName").ClientID %>').value;
        var Password = document.getElementById('<%= Login1.FindControl("Password").ClientID %>').value;
        var UserNameLabel = document.getElementById('<%= Login1.FindControl("UserNameLabel").ClientID %>');
        var PasswordLabel = document.getElementById('<%= Login1.FindControl("PasswordLabel").ClientID %>');
        var Errcolor = "red";
        var mycolor = "black";
        var ErrorString = "";
        if (UserName == '' || UserName == "You@domain.com") {
            UserNameLabel.style.color = Errcolor;
            ErrorString = "Error";

        }
        else
            UserNameLabel.style.color = mycolor;
        if (Password == '') {
            PasswordLabel.style.color = Errcolor;
            ErrorString = "Error";
        }
        else
            PasswordLabel.style.color = mycolor;

        if (ErrorString != "") {
            document.getElementById('loginError').style.display = '';
            return false;
        }

        document.getElementById('loginError').style.display = 'none';
        return true;
    }
</script>

<div id="login_form" style="background: none;">
    <asp:Login ID="Login1" runat="server" InstructionText="Please enter your user name and password for login."
        OnAuthenticate="Login1_Authenticate" OnLoginError="Login1_LoginError">
        <LayoutTemplate>
            <asp:Panel ID="DefaultButtonPanel" DefaultButton="ImageButton1" runat="server">
                <div class="main_box">
                    <div id="loginError" class="loginError" style="display: none;">
                        Please verify the highlighted fields.
                    </div>
                    <div class="sign_signup">
                        <span><strong style="color: #000; font-style: normal; font-size: 14pt;">Sign In</strong>
                        </span>or<span> <a href="SignUp.aspx" style="font-size: 14pt;">Sign Up</a></span>
                    </div>
                    <div class="row">
                        <div class="lable">
                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Email Address</asp:Label>
                        </div>
                        <div class="inp">
                            <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                        </div>
                        <div>
                            <asp:TextBoxWatermarkExtender ID="TBWE2" runat="server" TargetControlID="UserName"
                                WatermarkText="You@domain.com" WatermarkCssClass="watermarked" />
                        </div>
                    </div>
                    <div class="row">
                        <div class="lable">
                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password</asp:Label>
                        </div>
                        <div class="inp">
                            <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                        </div>
                    </div>
                    <div class="row" style="padding-top: 3px;">
                        <asp:CheckBox ID="RememberMe" runat="server" Font-Names="Arial" Font-Size="10pt"
                            Text=" Keep me signed in on this computer." />
                    </div>
                    <div class="row forgotPassword">
                        <asp:LinkButton ID="btnForgetPassword" runat="server" Text="Forgot your Password?"
                            OnClick="btnForgetPassword_Click"></asp:LinkButton>
                    </div>
                    <div style="width: 100%; padding-left: 165px;">
                        <asp:Button runat="server" ID="ImageButton1" Text="Sign In" CausesValidation="true"
                            class="genericButton" CommandName="Login" Font-Size="11pt" Font-Names="Arial"
                            OnClientClick="return SignInValidate();"></asp:Button>
                    </div>
                    <div class="rowLit">
                        <asp:Literal ID="FailureText" runat="server" EnableViewState="False" Visible="false"></asp:Literal>
                        <div id="divEmailError" runat="server" visible="false">
                            Email address not found. Please try again or <a href="SignUp.aspx" style="color: Red;
                                font-size: 11pt; text-decoration: underline;">sign up for an account</a>.
                        </div>
                        <div id="divPasswordError" runat="server" visible="false">
                            Incorrect password. Please try again or <a href="PasswordRecovery.aspx" style="color: Red;
                                font-size: 11pt; text-decoration: underline;">reset your password</a>.
                        </div>
                    </div>
                </div>
            </asp:Panel>
        </LayoutTemplate>
    </asp:Login>
</div>
